Type-Safe Covariant Specialization with Generalized Matching

نویسنده

  • Ran Rinat
چکیده

Matching is a relation between object types originally designed to support type-safe subclassing with binary methods. In this paper we generalize it to deal with general covariance by allowing eld and method parameter types to change covariantly in matching types. The result is a signiicant increase in the exibility of subclassing. The generalization is in a diierent direction than the recent proposal for supporting type-safe virtual types via matching between mutually recursive types. The new deenition is accompanied by appropriate machinery, allowing the loss of subsumption to be compensated by match-bounded parameterization and hash types, like in the language LOOM. As a bonus of the generalized approach to matching we also obtain a more exible typing for binary methods, allowing instances of a subclass to be supplied as argument. We deene a language LGM supporting generalized matching, its typing rules, and its operational semantics, and state a subject reduction theorem showing the soundness of the system.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Type-Safe Compilation of Covariant Specialization: A Practical Case

Despite its lack of type safety, some typed object-oriented languages use covariant specialization for methods. In this work, we show how one may modify the semantics of languages that use covariant specialization in order to improve their type safety. We demonstrate our technique using O2, a strongly and statically typed object-oriented database programming language which uses covariant specia...

متن کامل

Seventh International Workshop on Foundations of Object-Oriented Languages

The Seventh International Workshop on Foundations of Object-Oriented Languages (FOOL 7) was held on January 22, 2000, and it was colocated with the ACM Symposium on Principles of Programming Languages in Boston, Massachusetts, USA. Martı́n Abadi chaired the program committee, which received 19 submissions and accepted 6 of them. After the workshop, extended versions of 4 articles were solicited ...

متن کامل

"Real World" as an Argument for Covariant Specialization in Programming and Modeling

Class specialization is undoubtedly one of the most original and powerful features of object orientation as it structures object models at all stages of software development. Unfortunately, the semantics of specialization is not de ned with the same accuracy in the various elds. In programming languages, specialization is constrained by type theory and by a type safe policy, whereas its common ...

متن کامل

Spécialisation et sous-typage : thème et variations

Class specialization is the most original feature of object orientation, but identifying it to subtyping leads to the well known covariance-contravariance controversy. Type safety requires contravariance while specialization needs covariance. This paper aims to precisely analyse this problem, to show how irreductible it is and the need for type errors. We show that many alternatives as multiple...

متن کامل

Specialization inheritance and specialization bounded polymorphism

We define a specialization inheritance mechanism for object-oriented programming, admitting covariant redefinition of both methods and instance variables in subclassing. We investigate on the semantic weakness that makes such very flexible inheritance infeasible for a statically type-checked programming language supporting polymorphic assignment and polymorphic method invocation. We show that t...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:
  • Inf. Comput.

دوره 177  شماره 

صفحات  -

تاریخ انتشار 2002